home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 24 / CU Amiga Magazine's Super CD-ROM 24 (1998)(EMAP Images)(GB)(Track 1 of 2)[!][issue 1998-07].iso / CUCD / Programming / Asap / ASAP / FileRequester.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-09-19  |  1.9 KB  |  56 lines

  1. /*****************************************************************************
  2.  *                                                                           *
  3.  * ASAP - Amiga Software Authoring Platform                                  *
  4.  *                                                                           *
  5.  * Written by Laurie Perrin                                                  *
  6.  *                                                                           *
  7.  * AFileRequester wrapper class                                              *
  8.  *                                                                           *
  9.  *****************************************************************************/
  10.  
  11. #ifndef ASAP_AFileRequester_H
  12. #define ASAP_AFileRequester_H
  13.  
  14. #include <New.h>
  15.  
  16. extern "C"
  17. {
  18.  #include <Proto/ASL.h>
  19. }
  20.  
  21. class AFileRequester : public FileRequester
  22. {
  23.  public:
  24.  inline static AFileRequester * AllocFileRequest();
  25.  inline void * operator new(size_t);
  26.  inline void FreeFileRequest();
  27.  inline void * operator delete(void *fileReq); 
  28.  inline BOOL RequestFile();
  29. };
  30. //----------------------------------------------------------------------------
  31. AFileRequester * AFileRequester::AllocFileRequest ()
  32. {
  33.  return (AFileRequester *) ::AllocFileRequest();
  34. }
  35. //----------------------------------------------------------------------------
  36. void * AFileRequester::operator new (size_t)
  37. {
  38.  return AFileRequester::AllocFileRequest();
  39. }
  40. //----------------------------------------------------------------------------
  41. void AFileRequester::FreeFileRequest ()
  42. {
  43.  ::FreeFileRequest(this);
  44. }
  45. void AFileRequester::operator delete (void *fileReq)
  46. {
  47.  ((AFileRequest *) fileReq)->FreeFileRequest();
  48. }
  49. //----------------------------------------------------------------------------
  50. BOOL AFileRequester::RequestFile ()
  51. {
  52.  return ::RequestFile(this);
  53. }
  54.  
  55. #endif
  56.